<?php if($gid > 0 && $gid < 5) { ?>

<script>
	/*
	var jtoggle_more = $('.toggle_more');
	jtoggle_more.append('<li><button class="btn btn-secondary btn-sm toggle_more_button my-3">展开</button</li>');
	var jtoggle_more_button = jtoggle_more.find('.toggle_more_button');
	jtoggle_more_button.on('click', function() {
		if(jtoggle_more.height() > 100) {
			jtoggle_more.css('max-height', '100px');
		} else {
			jtoggle_more.css('max-height', '100000px');
		}
	});
	*/

// 删除日志帖子 / Delete post
$('body').on('click', '.update_log_delete', function() {
	var jthis = $(this);
	var href = jthis.attr('href');
	var jli = jthis.closest('li');
	var jfieldset = jli.closest('fieldset');
	var jupdates = jfieldset.find('span.updates');
	var logid = jli.data('logid');
	if(window.confirm('<?php echo lang('confirm_delete');?>')) {
		$.xpost(href, function(code, message) {
			if(code == 0) {
				jli.remove();
				jupdates.html(xn.intval(jupdates.html()) - 1);
			} else {
				$.alert(message);
			}
		});
	}
	return false;
});
	
</script>

<?php } ?>
